<nz-spin nzTip='加载数据中...' [nzSpinning]="isloading" [nzSize]="'large'">
  <form nz-form style="max-width: 1000px;margin-top: 30px;" [formGroup]='validateForm'>
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="24">
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired>选择班级</nz-form-label>
          <nz-form-control [nzSpan]="18">
            <nz-select nzPlaceHolder="请选择班级" formControlName="classInfoId" [nzAllowClear]='true' (ngModelChange)="getClassSet($event)">
              <nz-option *ngFor="let option of dataSet" [nzLabel]="option.label" [nzValue]="option.value">
              </nz-option>
            </nz-select>
            <nz-form-explain *ngIf="validateForm.get('classInfoId').dirty && validateForm.get('classInfoId').errors">请选择班级!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>

    <!-- 分组练习 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>分组练习</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <nz-input-group nzAddOnAfter="分/次">
              <input type="number" nz-input formControlName="groupScore">
            </nz-input-group>
            <nz-form-explain *ngIf="validateForm.get('groupScore').dirty && validateForm.get('groupScore').errors">设置分组练习分数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>次数（超过次数后不计分）</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="groupMaxTime">
            <nz-form-explain *ngIf="validateForm.get('groupMaxTime').dirty && validateForm.get('groupMaxTime').errors">设置最大计分次数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <!-- 分组教师评分 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>分组演练最高得分</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <nz-input-group nzAddOnAfter="分/次">
              <input type="number" nz-input formControlName="teacherGroupScore">
            </nz-input-group>
            <nz-form-explain *ngIf="validateForm.get('teacherGroupScore').dirty && validateForm.get('teacherGroupScore').errors">分组演练最高得分!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>次数（超过次数后不计分）</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="teacherGroupTime">
            <nz-form-explain *ngIf="validateForm.get('teacherGroupTime').dirty && validateForm.get('teacherGroupTime').errors">设置最大评分次数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <!-- 自由人联系 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>自由练习</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <nz-input-group nzAddOnAfter="分/次">
              <input type="number" nz-input formControlName="freeScore">
            </nz-input-group>
            <nz-form-explain *ngIf="validateForm.get('freeScore').dirty && validateForm.get('freeScore').errors">设置自由练习分数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>次数（超过次数后不计分）</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="freeMaxTime">
            <nz-form-explain *ngIf="validateForm.get('freeMaxTime').dirty && validateForm.get('freeMaxTime').errors">设置最大计分次数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <!-- 角色练习 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>角色练习</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <nz-input-group nzAddOnAfter="分/次">
              <input type="number" nz-input formControlName="roleScore">
            </nz-input-group>
            <nz-form-explain *ngIf="validateForm.get('roleScore').dirty && validateForm.get('roleScore').errors">设置角色练习分数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>次数（超过次数后不计分）</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="roleMaxTime">
            <nz-form-explain *ngIf="validateForm.get('roleMaxTime').dirty && validateForm.get('roleMaxTime').errors">设置最大计分次数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>

    <!-- 分数设置 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>演练分数</nz-form-label>
          <nz-form-control [nzSpan]="12">
            {{drillScore}}
            <!-- <input type="number" nz-input formControlName="drillPoint" readonly>
            <nz-form-explain *ngIf="validateForm.get('drillPoint').dirty && validateForm.get('drillPoint').errors">设置演练分数!</nz-form-explain> -->
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>报告分数</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="reportPoint">
            <nz-form-explain *ngIf="validateForm.get('reportPoint').dirty && validateForm.get('reportPoint').errors">设置最大计分次数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <!-- 演练百分比 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>演练分占比</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="drillPercent">
            <nz-form-explain *ngIf="validateForm.get('drillPercent').dirty && validateForm.get('drillPercent').errors">设置演练分占比!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>报告分占比</nz-form-label>
          <nz-form-control [nzSpan]="12">
            {{reportPercent}}
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <!-- 总分数 -->
    <div nz-row [nzGutter]="8">
      <div nz-col [nzSpan]="12">
        <nz-form-item>
          <nz-form-label [nzSpan]="12" nzRequired>总分数</nz-form-label>
          <nz-form-control [nzSpan]="12">
            <input type="number" nz-input formControlName="totalPoint">
            <nz-form-explain *ngIf="validateForm.get('totalPoint').dirty && validateForm.get('totalPoint').errors">设置演练总分数!</nz-form-explain>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>
    <nz-form-item>
      <nz-form-control [nzSm]="14" [nzXs]="24" [nzOffset]="12">
        <button nzType="primary" nz-button (click)="submitForm($event)">保存</button>
        <button nz-button (click)="resetForm($event)">取消</button>
      </nz-form-control>
    </nz-form-item>
  </form>
</nz-spin>
